
package com.j2eefast.flowable.bpm.service;


import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.j2eefast.common.core.page.Query;
import com.j2eefast.common.core.utils.PageUtil;
import com.j2eefast.flowable.bpm.entity.InformationEntity;
import com.j2eefast.flowable.bpm.entity.ProjectArchivesEntity;
import com.j2eefast.flowable.bpm.mapper.ArchivesMapper;
import com.j2eefast.flowable.bpm.mapper.InformationMapper;
import com.j2eefast.flowable.bpm.mapper.StudyVidoeMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;


/**
 * <p></p>
 *
 * @author: guoshenghui
 * @date: 2021-05-16 00:02
 * @web: http://www.letukeji.cn
 * @version: 1.0.1
 */

@Service
//@Transactional(readOnly = true)
public class StudyVidoeService extends ServiceImpl<ArchivesMapper, ProjectArchivesEntity> {

	@Resource
	protected StudyVidoeMapper studyVidoeMapper;

	public PageUtil VidoeList(Map<String, Object> params) {
		String title = (String) params.get("title");	//文件名称
		String username=(String)params.get("username");
		String mold=(String)params.get("mold");
		Page<InformationEntity> page = studyVidoeMapper.VidoeList(new Query<ProjectArchivesEntity>(params).getPage(),
				StrUtil.nullToDefault(title,""),
				StrUtil.nullToDefault(username,"")
		,StrUtil.nullToDefault(mold,""));
		return new PageUtil(page);
	}

	public InformationEntity getVideoById(Long id){
		return studyVidoeMapper.getVideoById(id);
	}

	public boolean updateByIds(InformationEntity informationEntity){
		return studyVidoeMapper.updateByIds(informationEntity);
	}

	public boolean deleteVideo(Long[] ids){
		return studyVidoeMapper.deleteVideo(ids);
	}

	public boolean upload(InformationEntity informationEntity){
		return studyVidoeMapper.upload(informationEntity);
	}

}
